package com.eshopkeeper.core.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/11/8.
 */
public class SensitiveWordInitUtil {
    public static final Logger logger = LogManager.getLogger(SensitiveWordInitUtil.class);

    public static void constructingSensitiveLexicon (List<String> sensitiveWords) throws Exception {
        SensitiveWordInit sensitiveWordInit = new SensitiveWordInit();
        Map sensitiveWordMap = sensitiveWordInit.addSensitiveWordToHashMap(sensitiveWords);
        RedisUtil.set("SensitiveWords", (Serializable) sensitiveWordMap);
        logger.info("敏感詞庫:" + sensitiveWordMap);
    }
}
